package Cantella::DJabberd::Model::Admin::RosterGroup::Action::Create;

use Reaction::Class;

#use Reaction::Types::Core qw( NonEmptySimpleStr );
use aliased 'Reaction::InterfaceModel::Action::DBIC::ResultSet::Create' => 'DBIC_Create';

class Create is DBIC_Create, which {

#  has name => (is => 'rw', isa => NonEmptySimpleStr, lazy_fail => 1);
  has roster_items => (
                       is  => 'rw',
                       isa => 'ArrayRef',
                       valid_values => sub {
                         shift->target_model->result_source
                           ->related_source('roster_group_items')
                             ->relates_source('roster_item')->resultset;
                       }
                      );

 # has owner =>
 #   (
 #    is           => 'rw',
 #    isa          => 'Cantella::DJabberd::Store::Result::UserJid',
 #    lazy_fail    => 1,
 #    valid_values => sub {
 #      shift->target_model->result_source->related_source('owner')
 #        ->resultset;
 #    },
 #   );

};

1;
